<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				margin: 0;
				padding: 0;
			}
			#box{
				position: relative;
				width: 250px;
				height: 150px;
				background-color: red;
				margin: 50px auto;
				text-align: center;
				line-height: 150px;
				color: purple;
				font-size: 30px;
				font-weight: bold;
				transition: 2s;
			}
			
			#box div{
				position: absolute;
				width: 0;
				height: 30px;
				background-color: green;
				transition: 2s;
			}
			
			#box .topBox{
				left: 0;
				top: 0;
			}
			
			#box .bottomBox{
				right: 0;
				bottom: 0;
			}
			
		</style>
	</head>
	<body>
		<div id="box">
			懒人马大哥
			<div class="topBox"></div>
			<div class="bottomBox"></div>
		</div>
		
		<script type="text/javascript">
			var box = document.querySelector('#box');

            var topBox = document.querySelector('.topBox');
            var bottomBox = document.querySelector('.bottomBox');

            box.onmouseenter = function(){
                topBox.style.width = '250px';
                bottomBox.style.width = '250px';
                topBox.style.backgroundColor = 'aqua';
                bottomBox.style.backgroundColor = 'aqua';
                this.style.backgroundColor = 'skyblue';
                this.style.color = 'hotpink';
            }

            box.onmouseleave = function(){
                topBox.style.width = 0;
                bottomBox.style.width = 0;
                topBox.style.backgroundColor = '';
                bottomBox.style.backgroundColor = '';
                this.style.backgroundColor = '';
                this.style.color = '';
            }
		</script>
	</body>
</html>